﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HardwareLibrary.EQLibrary
{
    public class EQ2008Helper
    {
        public static void OpenLED(int LED_ID)
        {
            EQ2008_API.User_OpenScreen(LED_ID);
        }
        public static void CloseLED(int LED_ID)
        {
            EQ2008_API.User_CloseScreen(LED_ID);
        }
        public static void SendSimpleStrToLED(int LED_ID, string Text)
        {
            EQ2008_API.User_DelAllProgram(LED_ID);
            EQ2008_API.User_AddProgram(LED_ID, false, 0);
            EQLibrary.User_Text text;
            text.BkColor = 0;
            text.chContent = Text;
            text.PartInfo.FrameColor = 0;
            text.PartInfo.iFrameMode = 0;
            text.PartInfo.iHeight = 96;
            text.PartInfo.iWidth = 256;
            text.PartInfo.iX = 0;
            text.PartInfo.iY = 0;
            text.FontInfo.bFontBold = Convert.ToBoolean(EQ2008_API.EQ_TRUE);
            text.FontInfo.bFontItaic = Convert.ToBoolean(EQ2008_API.EQ_FALSE);
            text.FontInfo.bFontUnderline = Convert.ToBoolean(EQ2008_API.EQ_FALSE);
            text.FontInfo.colorFont = EQ2008_API.YELLOW;
            text.FontInfo.iFontSize = 12;
            text.FontInfo.strFontName = "";
            text.FontInfo.iAlignStyle = 0;
            text.FontInfo.iVAlignerStyle = 0;
            text.FontInfo.iRowSpace = 0;
            text.MoveSet.bClear = Convert.ToBoolean(0);
            text.MoveSet.iActionSpeed = 4;
            text.MoveSet.iActionType = 1;
            text.MoveSet.iHoldTime = 1200;
            text.MoveSet.iClearActionType = 1;
            text.MoveSet.iClearSpeed = 4;
            text.MoveSet.iFrameTime = 12;
            EQ2008_API.User_AddText(LED_ID, ref text, EQ2008_API.g_iProgramIndex);
        }
    }
}
